package wang.yangziqing.app_kotlin.ui.activity

import android.preference.PreferenceManager
import android.support.v7.widget.Toolbar
import org.jetbrains.anko.find
import org.jetbrains.anko.toast
import wang.yangziqing.app_kotlin.R
import wang.yangziqing.app_kotlin.base.BaseActivity
import wang.yangziqing.app_kotlin.utils.ToolBarManager

/**
 * Created by Administrator on 2017/11/29.
 */
class SettingActivity : BaseActivity(), ToolBarManager {
    override val toolbar by lazy {
        find<Toolbar>(R.id.toolbar)
    }

    override fun getLayoutId(): Int {
        return R.layout.act_setting
    }

    override fun initData() {
        super.initData()
        initSettingToolbar()
//获取设置保存的状态
        val sp = PreferenceManager.getDefaultSharedPreferences(this)
        val nowifi = sp.getBoolean("nowifi", false)
        val push = sp.getBoolean("push", false)
        toast("开关:$nowifi,推送:$push")
    }

}